﻿using Newtonsoft.Json;
using Pay.Core;
using Pay.TO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pay.DTO
{
    /// <summary>
    /// 广告表 mc_Advertisement
    /// </summary>
    [Serializable]
    [JsonObject(MemberSerialization.OptOut)]
    public class advertisement_dto
    {
        /// <summary>
        /// 广告Id
        /// </summary>
        public long id { get; set; }

        /// <summary>
        /// 位置类型
        /// </summary>
        public EAdvertisementPositionType position_type { get; set; }

        /// <summary>
        /// 位置类型枚举描述
        /// </summary>
        public string position_type_title { get { return this.position_type.ToDescription(); } }

        /// <summary>
        /// 排序
        /// </summary>
        public int sort { get; set; }

        /// <summary>
        /// 图片URL
        /// </summary>
        public string img_url { get; set; }

        /// <summary>
        /// 链接地址
        /// </summary>
        public string link_url { get; set; }
        /// <summary>
        /// 标题
        /// </summary>
        public string title { get; set; }
        /// <summary>
        /// 副标题
        /// </summary>
        public string subtitle { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string content { get; set; }

        /// <summary>
        /// 状态（1：正常，2：停用）
        /// </summary>
        public EAdvertisementStatus status { get; set; }

        /// <summary>
        /// 状态枚举描述
        /// </summary>
        public string status_title { get { return this.status.ToDescription(); } }

        /// <summary>
        /// 点击次数
        /// </summary>
        public int click_num { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime begin_time { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime? end_time { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime create_time { get; set; }

        /// <summary>
        /// 是否在AppStore版本中显示
        /// </summary>
        public bool is_app_store_show { get; set; }
    }

    [Serializable]
    [JsonObject(MemberSerialization.OptOut)]
    public class advertisement_dto_ex : advertisement_dto
    {
        /// <summary>
        /// 位置类型枚举下拉数据
        /// </summary>
        public List<DropdownItem> e_position_type_list
        {
            get { return typeof(EAdvertisementPositionType).GetDropdownItemList(); }
        }
        /// <summary>
        /// 位置类型枚举值
        /// </summary>
        public string position_type_value { get; set; }

        /// <summary>
        /// 状态枚举下拉数据
        /// </summary>
        public List<DropdownItem> e_status_list
        {
            get { return typeof(EAdvertisementStatus).GetDropdownItemList(); }
        }
        /// <summary>
        /// 状态枚举值
        /// </summary>
        public string status_value { get; set; }

    }
    [Serializable]
    public class ad_dto
    {
        public long id { get; set; }
        /// <summary>
        /// 广告地址
        /// </summary>
        public string img_url { get; set; }
        /// <summary>
        /// 链接地址
        /// </summary>
        public string link_url { get; set; }
        /// <summary>
        /// 是否在AppStore版本中显示
        /// </summary>
        public bool is_app_store_show { get; set; }
        /// <summary>
        /// 标题
        /// </summary>
        public string title { get; set; }
        /// <summary>
        /// 副标题
        /// </summary>
        public string subtitle { get; set; }
    }

    [Serializable]
    public class ad_type_dto
    {
        /// <summary>
        /// 广告位类型（1：首页banner，2：任务列表页顶部，3：消费页，4：我的页拓垦大陆，5：商品兑换）
        /// </summary>
        public int type { get; set; }
        /// <summary>
        /// 该类型下的广告列表
        /// </summary>
        public List<ad_dto> ad_list { get; set; }
    }
}
